<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../core/include.inc.jsp"%>

<form id="pagerForm" method="post" action="pay_list">
    <input type="hidden" name="pageNum" value="${pageModel.pageNum}" />
    <input type="hidden" name="numPerPage" value="${pageModel.numPerPage}" />
    <input type="hidden" name="payUserTel" value="${propertyPay.payUserTel}" />
    <input type="hidden" name="blockId" value="${propertyPay.blockId}" />
    <input type="hidden" name="payFeeNum" value="${propertyPay.payFeeNum}" />
    <input type="hidden" name="payUser" value="${propertyPay.payUser}" />
    <input type="hidden" name="payState" value="${propertyPay.payState}" />
    <input type="hidden" name="payType" value="${propertyPay.payType}" />
</form>
<form onsubmit="return navTabSearch(this);" action="pay_list" method="post">
    <div class="pageHeader">
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label>联系方式</label>
                    <input type="text" name="payUserTel" value="${propertyPay.payUserTel}" class="textInput" placeholder="用户联系方式"/>
                </li>
                <li>
                    <label>小区</label>
                    <select class="combox" name="blockId" id="blockId" onchange="getFeeType()">
                        <option value="0">全部小区</option>
                        <c:forEach var="item1" items="${blockList}">
                            <option value="${item1.id}" <c:if test="${item1.id==propertyPay.blockId}">selected</c:if>>${item1.blockName}</option>
                        </c:forEach>
                    </select>
                </li>
                <li>
                    <label>物业费户号</label>
                    <input type="text" name="payFeeNum" value="${propertyPay.payFeeNum}" class="textInput" placeholder="物业费户号"/>
                </li>
                <li>
                    <label>姓名</label>
                    <input type="text" name="payUser" value="${propertyPay.payUser}" class="textInput" placeholder="姓名"/>
                </li>

            </ul>
            <div class="subBar">
                <ul style="float: left">
                    <li>
                    <li>
                        <label>缴费状态</label>
                        <select class="combox" name="payState">
                            <option value="">全部状态</option>
                            <option value="欠费" <c:if test="${propertyPay.payState=='欠费'}">selected</c:if>>欠费</option>
                            <option value="正常" <c:if test="${propertyPay.payState=='正常'}">selected</c:if>>正常</option>
                        </select>
                    </li>
                    <li>
                        <label>缴费类型</label>
                        <select class="combox" name="payType">
                            <option value="">全部缴费类型</option>
                            <c:forEach var="item" items="${typeList}">
                                <option value="${item.paymentType}" <c:if test="${item.paymentType==propertyPay.payType}">selected</c:if>>${item.paymentType}</option>
                            </c:forEach>
                        </select>
                    </li>

                    </li>
                </ul>
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit" onclick="return check111()">检索</button></div></div></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="pageContent">
        <div class="panelBar">
            <ul class="toolBar">
                <li><a class="add" href="to_pay_add" target="dialog" rel="to_pay_add"
                       width="600" height="400" mask="true"><span>新增</span></a></li>
                <li class="line">line</li>
                <li><a class="edit" href="to_excel_to_db" target="dialog" rel="to_excel_to_db"
                       width="600" height="400" mask="true"><span>批量导入</span></a></li>
                <input type="hidden" name="headImage" class="logo" value="" />
                <li class="line">line</li>
                <li>
                    <a class="edit" href="http://jielan.oss-cn-hangzhou.aliyuncs.com/images/wcity/payExcelModel.xls">
                        <span>下载模板</span>
                    </a>
                </li>
                <li class="line">line</li>
                <li><a class="edit" href="to_pay_edit?id={item_id}" target="dialog" rel="to_pay_edit"
                       width="600" height="400" mask="true"><span>修改</span></a></li>
                <li class="line">line</li>
                <li><a class="delete" href="pay_delect?id={item_id}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
                <li class="line">line</li>
                <li><a class="edit" href="pay_model?payUserTel=${propertyPay.payUserTel}&blockId=${propertyPay.blockId}&payFeeNum=${propertyPay.payFeeNum}&payUser=${propertyPay.payUser}&payState=${propertyPay.payState}&payType=${propertyPay.payType}"><span>导出excel</span></a></li>
                <li class="line">line</li>
            </ul>
        </div>
        <table class="table" width="100%" layoutH="137">
            <thead>
            <tr>
                <th>序号</th>
                <th>物业/社区名称</th>
                <th>小区名称</th>
                <th>物业费户号</th>
                <th>详细地址</th>
                <th>住户姓名</th>
                <th>联系方式</th>
                <th>缴费类型</th>
                <th>收费标准</th>
                <th>应缴金额</th>
                <th>收费日期</th>
                <th>费用周期</th>
                <th>状态</th>
                <th>备注</th>
                <th>更新时间</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="item" items="${list}" varStatus="st">
                <tr target="item_id" rel="${item.id}" ondblclick="tableclick()">
                    <td>${st.index+1}</td>
                    <td>${item.payProName}</td>
                    <td>${item.payBlockName}</td>
                    <td>${item.payFeeNum}</td>
                    <td>${item.payUserAddr}</td>
                    <td>${item.payUser}</td>
                    <td>${item.payUserTel}</td>
                    <td>${item.payType}</td>
                    <td>${item.payCharge}</td>
                    <td>${item.payMoney}</td>
                    <td>
                        <fmt:formatDate value="${item.payDate}" pattern="yyyy-MM-dd"/>
                    </td>
                    <td>
                        <fmt:formatDate value="${item.payStartDate}" pattern="yyyy-MM-dd"/>
                        <span>-</span>
                        <fmt:formatDate value="${item.payEndDate}" pattern="yyyy-MM-dd"/>
                    </td>
                    <td>${item.payState}</td>
                    <td>${item.payRemark}</td>
                    <td>
                        <fmt:formatDate value="${item.payUpdate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <c:import url="../core/pagebar.inc.jsp" />
    </div>
</form>
<script>
    /*function getFeeType() {
        var blockName = $("#blockId").val();
        $("#payType").html("<option value=''>全部缴费类型</option>");
        $.ajax({
            type:"post",
            url:"get_pay_type",
            data:{"blockName":blockName},
            dataType:"json",
            success:function(data){
                console.log(data);
                $.each(data,function(i, inner) {
                    $("#payType").append("<option value='"+inner+"'>"+inner+"</option>");
                })
            }
        })
    }*/

    // 设置图片地址
    function setImage(index,url) {
        $('.imgList').eq(index).attr('src',url);
        $('.logo').eq(index).val(url);
    }

    function upload(index) {
        uploadImage(index,$('.imgFile').eq(index).get(0).files[0]);
    }

    /*function check111() {
        alert($("select[name='blockId']").val());
    }*/
</script>

